package com.wang.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class SpringUtils {

    private static ApplicationContext applicationContext;

    public SpringUtils(ApplicationContext applicationContext){
        SpringUtils.applicationContext=applicationContext;
    }

    public static <T> T getBean(Class<T> tClass){
        return applicationContext.getBean(tClass);
    }


}
